This invention relates to machine vision, and particularly to methods for gauging and otherwise determining distances within an image.
In model-based recognition, there is a need to not only find an instance of a model in an image, but also to sometimes measure one or several attributes of the instance of the model in the image to verify that the instance of the model in the image is within a predetermined tolerance. This measurement is most commonly accomplished by applying one or more vision tools to the image, after an instance of the model has been located, so as to determine distances between selected points within the instance of the model in the image. For example, a common way to determine distances between selected points within the instance of the model in the image is to first find an instance of a model in the image, and then to specify absolute locations within the model which some other vision tool (such as a caliper) can then use to measure (also called xe2x80x9cto gaugexe2x80x9d) some particular distance between two selected points, i.e., some xe2x80x9cdimensionxe2x80x9d, of the model.
The reason that an extra vision tool application is almost always required for such a gauging step is that the most powerful pattern matching techniques known in the art can locate an instance of a model in an image up to a linear deformation (such as uniform rotation or scaling), but cannot detect regular nonlinear deformations between the model and the image. An example is shown in FIG. 1, wherein a cross 10 can be detected as having a linear scale change into a scaled cross 12, but the shortening effect evident in the shortened scaled cross 14 cannot be detected, and consequently the shortened scaled cross 14 is usually erroneously interpreted as missing an edge.
A method is provided for measuring distances between locations in an image. The method includes using sub-models to find a plurality of locations in an image, then labeling the locations and determining distances using the labels. In a preferred embodiment, the method further includes performing a projection of a distance along a direction so as to provide a projected distance. In a further preferred embodiment, the projected distance is either a length, a width, a depth, a height, a thickness, or a size.
In other preferred embodiments, using sub-models includes finding a position of a full model in the image using sub-models.
In yet other preferred embodiments, the found distances are evaluated, either with respect to a tolerance, or other range or threshold. In further preferred embodiments, the tolerance is transformable.
In alternate preferred embodiments, determining distances using the labels includes identifying pairs of locations, and in further preferred embodiments, then identifying groups of pairs of locations. It is also preferred to then compute an average distance using an identified group of pairs of locations.
The present invention can use the output of a sub-model based shape finder, such as the one described in the co-pending patent application Ser. No. 09/054,968, issued as U.S. Pat. No. 6,324,299, entitled xe2x80x9cObject Image Search using Sub-Models,xe2x80x9d herein incorporated by reference.
The invention improves upon conventional gauging techniques by exploiting information typically provided by a sub-model based shape finder so as to eliminate one or more computationally intensive applications of one or more vision tools. More specifically, the features of the found instance of a model that are used as a basis for performing measurements are those features that have already been accurately located by the sub-model based shape finder.
The method of the invention is easily configurable, because the dimensions to be gauged are defined by specifying one or more pairs of sub-models along the relevant dimensions, and the minimum and maximum limits on the range of the measurement. Also, the feature-to-feature distance used for gauging can be specified as an absolute distance, or alternatively, as a projection along an angle. Lastly, the tolerance can be flexibly specified, for example, as an absolute quantity, as a percentage of nominal value, or any other way.